# -*- encoding: utf-8 -*-
# @Author : lijing
# @Time : 2021/2/4 17:12
from datetime import time, datetime
import pytest
from apscheduler.schedulers.blocking import BlockingScheduler

def mid_job():
    print("开始执行中频测试:", datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
    pytest.main(["-v", "-s", "./case/test_mid_fre_case.py", "--html=./report/report.html", "--reruns", "2"])
    print("中频测试执行完毕:", datetime.now().strftime("%Y-%m-%d %H:%M:%S") )
    # pytest.main(["-v", "-s", "./case/test_mid_fre_case.py"])
if __name__ == '__main__':
    print(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
    mid_job()
    # scheduler = BlockingScheduler()
    # # 每隔1小时触发一次
    # scheduler.add_job(mid_job, 'interval', hours=0.5)
    # scheduler.start()